import request from '@/utils/request'

export function getList(prefix,pageNum) {
  return request({
    url: prefix+'?pageNum=' + pageNum,
    method: 'get',
  })
}

export function getSearchList(prefix,data,pageNum) {
  return request({
    url: prefix+'/search?pageNum=' + pageNum,
    method: 'post',
    data
  })
}

export function add(prefix,data) {
  return request({
    url: prefix,
    method: 'post',
    data
  })
}

export function edit(prefix,data) {
  return request({
    url: prefix,
    method: 'put',
    data
  })
}

export function remove(prefix,data) {
  return request({
    url: prefix,
    method: 'delete',
    data
  })
}
// getListWithoutPage
export function getListWithoutPage(prefix) {
  return request({
    url: prefix+'?isPage=0',
    method: 'get',
  })
}

export function getByPathVariable(uri,data) {
  return request({
    url:uri+"/"+data,
    method: 'get',
  })
}

export function postByData(uri,data) {
  return request({
    url:uri,
    method: 'post',
    data
  })
}